﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Favoritos.aspx.cs" Inherits="bba.framework.infraweb.tests.infraWebMode.Favoritos" EnableTheming="false" Theme=""  %>

<%@ Register assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Web.UI.WebControls" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-br"
lang="pt-br">

<head>
<base target=_self>

<title>Favoritos</title>

<link type="text/css" rel="stylesheet" href="<%= ResolveUrl("~/App_Themes/InfraWebTheme/Favoritos.css")%>"></link>
<link type="text/css" rel="stylesheet" href="<%= ResolveUrl("~/App_Themes/InfraWebTheme/Autocomplete.css")%>"></link>

<script type="text/javascript">
        var baseUrl = "<%= ResolveUrl("~/") %>";
</script>

<script language="javascript" type="text/javascript" src="<%= ResolveUrl("~/Scripts/jquery-1.3.2.min.js") %>"></script>
<script language="javascript" type="text/javascript" src="<%= ResolveUrl("~/Scripts/autocomplete.js") %>"></script>
<script language="javascript" type="text/javascript" src="<%= ResolveUrl("~/Scripts/menu.js") %>"></script>

<script type="text/javascript">
    $(document).ready(function() {
        eventosFavoritos();
        autocompleteLinks();  
    });
</script>

</head>
<body >
	<div id="todo" class="todo">
	<div class="cabecalho">
		<p>Cadastro de Links Favoritos</p>
	</div>
	<div class="titCadastro";>
	<form method="post" class="formBuscaLink">
		<input name="txt_BuscaLink" class="txtBuscaLink" type="text"/>&nbsp;
    </form>
	</div>
	<div id="Cadastro">
		<div id="titCadastro" class="titCadastro">Pesquisar página pelo nome </div>
		<form id="form1" runat="server" class="form">
		<table ="tb_Main" class="tbMain" style="margin-left:58px;width:450px">
			<tr>
				<td>
				    <label id="Label1">Nome: </label>
				</td>
				<td>
				    <asp:TextBox id="txtNomeFavorito"  runat="server" Width="219px" MaxLength="250" ></asp:TextBox>
				</td>
			</tr>
			<tr>
				<td>
				    <label id="Label1">Categoria: </label>
				</td>
				<td style="border-top-style:solid;border-top-width:1px">
				<div align="left">
                    <asp:DropDownList CssClass="CategoryTextBox" ID="categoryDropDown" runat="server" Width="180px"></asp:DropDownList>	
				    <asp:ImageButton CssClass="CategoryButton" ID="ImageButton1"  runat="server" ImageUrl="~/App_Themes/InfraWebTheme/images/excluir.png" OnClick="btnExcluir_Click"/>
				    <asp:ImageButton CssClass="CategoryButton" ID="novaCategoriaImageButton"  runat="server" ImageUrl="~/App_Themes/InfraWebTheme/images/novacategoria.png" OnClick="newCategoryButton_Click"/>
				</div>    
				</td>
			</tr>
			<tr>
			    <td>
			    </td>
			    <td style="border-bottom-style:solid;border-bottom-width:1px;" align="left">
				    <div align="left" class="newCategoryContainer">
				    <asp:TextBox id="newCategoryTextBox" CssClass="CategoryTextBox" runat="server" Visible="False" Width="219px" MaxLength="250" ToolTip="Insira a nova categoria"></asp:TextBox>
				    <asp:ImageButton ID="addButton1" runat="server" ImageUrl="~/App_Themes/InfraWebTheme/images/ok.png" OnClick="addButton_Click" Visible="False" Height="22px" Width="65px" />
				    </div>    
                </td>
			</tr>
			<tr>
				<td>
				    <label id="lblCaminho">Caminho </label>
				</td>
				<td>
				    <label id="lbl_Url" class="lblUrl"></label>
				</td>
			</tr>
			<div style="visibility:hidden">
				<asp:TextBox id="hiddenUrl" CssClass="clhiddenUrl" runat="server" Visible="true"></asp:TextBox>
			</div>
			<tr>
				<td>
				</td>
				
				<td align=right>
				    <asp:Label ID="lblMessage" runat="server" Text="dynamic" Visible="False" ForeColor="#CC3300"></asp:Label>
				    
				</td>
			</tr>
			<tr>
			    <td>
			    </td>
			    <td valign="bottom" align="left" style="padding-top:30px">
			        <asp:ImageButton ID="adicionarImageButton" runat="server" ImageUrl="~/App_Themes/InfraWebTheme/images/adicionar.png" OnClick="addFavoriteButton_Click" />
			        
				    
				    <asp:ImageButton ID="cancelarImageButton" runat="server" ImageUrl="~/App_Themes/InfraWebTheme/images/cancelar.png" OnClientClick="closeWindow()" />
                    </td>
			</tr>
		</table>	
		</div>
		<div id="itsthetable" class="form">
		<div class="grid" style="margin-left:60px">
		    <asp:GridView  ID="favoritesGridView" runat="server" AllowPaging=True
		     AutoGenerateColumns="False" DataKeyNames="Id"
                EmptyDataText="Não existe nenhum favorito cadastrado" PageSize="5" 
                onpageindexchanging="favoritesGridView_PageIndexChanging" 
                onrowdeleting="favoritesGridView_RowDeleting" CellPadding="3" 
                Width="500px">
		    <HeaderStyle CssClass=odd/>
		    <Columns>
		    <asp:TemplateField AccessibleHeaderText="Categoria" HeaderText="Categoria">
		    <EditItemTemplate>
                   <asp:TextBox ID="NameCategoryTextBox" runat="server"></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="NameCategoryRow" runat="server" Text='<%# Eval("Category.Name") %>' />
            </ItemTemplate>
            </asp:TemplateField>
		    <asp:TemplateField AccessibleHeaderText="Favorito" HeaderText="Favorito">
            <ItemTemplate>
                <asp:Label ID="NameFavoriteRow" runat="server" Text='<%# Eval("Name") %>' />
            </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField AccessibleHeaderText="Url" HeaderText="Url" HeaderStyle-Width="350">
            <ItemTemplate>
                <asp:Label ID="UrlRow" runat="server" Text='<%# Eval("Url") %>' />
            </ItemTemplate>

            <HeaderStyle Width="350px"></HeaderStyle>
            </asp:TemplateField>
		        <asp:CommandField DeleteText="Excluir" ShowDeleteButton="True"/>
		    </Columns>
            </asp:GridView>
		</div>

		</div>

</div>
</form>
<input name="linkDescriptions" id="linkDescriptions" type="hidden" value="0" />
<input name="linkIds" id="linkIds" type="hidden" value="0" />
<input name="linkUris" id="linkUris" type="hidden" value="0" />
<input name="linkParentDescriptions" id="linkParentDescriptions" type="hidden" value="0" />
<input name="linkParentIds" id="linkParentIds" type="hidden" value="0" />

</body>

</html>
